﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UMS.Essences
{
    public class Contact:IMan
    {
        public string Name
        {
            get;
            set;
        }
        public List<Connection> Connections
        {
            get;
            set;
        }
        public double Rating { get { return rate; } }
        public double rate;

        public event SentMessageHandler ContactSentMessage;
        protected void OnContactSentMessage(SentMessageEventArgs e)
        {
            ContactSentMessage(this,e);
        }

        public Contact()
        {
            rate = 1;
        }

        public void UpContactRate()
        {
            rate += rate / 10;
        }
        public void DownUserRate()
        {
            rate -= rate / 10;
        }
    }

    public class SentMessageEventArgs:EventArgs
    {
        public Message Msg {get{return m;}}
        Message m;
        public SentMessageEventArgs(Message _m):base()
        {
            m = _m;
        }
    }
    public delegate void SentMessageHandler(object sender, SentMessageEventArgs e);
}
